package com.ruoyi.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseDomain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 公共菜单对象 com_menu
 *
 * @author sunye
 * @date 2024-09-26
 */
@Data
public class ComMenu extends BaseDomain
{
    private static final long serialVersionUID = 1L;

    @TableId(value ="menu_id", type = IdType.AUTO)
    private Long menuId;

    @Excel(name = "菜单名称")
    private String menuName;

    @Excel(name = "父菜单ID")
    private Long parentId;

    @Excel(name = "显示顺序")
    private Long orderNum;

    @Excel(name = "路由地址")
    private String path;

    /** 路由参数 */
    private String query;

    @Excel(name = "组件路径")
    private String component;

    @Excel(name = "菜单类型")
    private String menuType;

    private Long functionId;

    private String delFlag;

    @TableField(exist = false)
    private Long deptId;




    /** 创建者 */
    private String createBy;
    /** 更新者 */
    private String updateBy;


    /** 菜单图标 */
    private String icon;

    /** 子菜单 */
    @TableField(exist = false)
    private List<ComMenu> children = new ArrayList<ComMenu>();

    /** 绑定的菜单类型（1系统 2小程序 3数字商城） */
    @TableField(exist = false)
    private String type;

    /** appId */
    @TableField(exist = false)
    private String appId;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("menuId", getMenuId())
            .append("menuName", getMenuName())
            .append("parentId", getParentId())
            .append("orderNum", getOrderNum())
            .append("path", getPath())
            .append("component", getComponent())
            .append("menuType", getMenuType())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("delFlag", getDelFlag())
            .append("icon", getIcon())
            .toString();
    }
}
